home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-03 | 901 b | 56 lines | [TEXT/PJMM] |
- unit MySpeak;
-
- interface
-
- procedure InitSpeak;
- procedure FinishSpeak;
- function SpeakBusy: boolean;
- procedure SpeakStr (s: str255);
- procedure Speak (id, index: integer);
- function SpeechAvailable: boolean;
-
- implementation
-
- uses
- Speech;
-
- function SpeechAvailable: boolean;
- var
- v: longInt;
- begin
- SpeechAvailable := (Gestalt(gestaltSpeechAttr, v) = noErr) & BTST(v, gestaltSpeechMgrPresent);
- end;
-
- function SpeakBusy: boolean;
- begin
- SpeakBusy := SpeechAvailable and (SpeechBusy > 0);
- end;
-
- procedure SpeakStr (s: str255);
- begin
- if not SpeechAvailable | (SpeakString(s) <> noErr) then begin
- SysBeep(1);
- end;
- end;
-
- procedure Speak (id, index: integer);
- var
- s: str255;
- begin
- GetIndString(s, id, index);
- SpeakStr(s);
- end;
-
- {$S Init}
- procedure InitSpeak;
- begin
- end;
-
- {$S Term}
- procedure FinishSpeak;
- begin
- if SpeechAvailable then
- SpeakStr('');
- end;
-
- end.